package com.ruoyi.system.feign;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.domain.News;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "ruoyi-heima-news")
public interface NewsClient {
    @PostMapping("/news")
    @ApiOperation("新增新闻")
    AjaxResult add(@RequestBody News tbNews);

    @PutMapping("/news")
    @ApiOperation("修改新闻")
    AjaxResult edit(@RequestBody News tbNews);

    @DeleteMapping("/news/{newsIds}")
    @ApiOperation("批量删除新闻")
    AjaxResult remove(@PathVariable("newsIds") Long[] newsIds);

    @GetMapping("/news/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);


    @PutMapping("/news/notice")
    public AjaxResult updateByNoticeId(@RequestBody News tbNews);

    @DeleteMapping("/news/notice/{noticeIds}")
    @ApiOperation("批量删除新闻")
    AjaxResult removeByNoticeIds(@PathVariable("noticeIds") Long[] noticeIds);
}
